package com.zmn.plat.business.impl.upload;

import com.zmn.common.utils.string.StringUtil;

/**
 * 解析url工具类
 * 
 * @author linfeng
 * @version v1.0
 * @since 2020/06/05 14:18
 **/
public class UrlUtils {

    /**
     * 根据文件url获取文件名
     * 
     * @param urlFile
     * @return
     */
    public static String getUrlFileName(String urlFile) {
        String fileName = "";
        if (StringUtil.isNotBlank(urlFile)) {
            Integer index = urlFile.lastIndexOf("/");
            if (index != null && index >= 0) {
                fileName = urlFile.substring(index + 1);
            }
        }

        return fileName;
    }

}
